home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / business / autorexx.lha / PlugIns / AddDate.rexx next >
OS/2 REXX Batch file  |  1996-12-28  |  848b  |  42 lines

  1. /*
  2.     AddDate.rexx - DB PlugIn : Auto-Insert current date into DB field.
  3.     (c) 1996 Karl Mottram - Bifrost Industries
  4.     Started 1530 hrs - 03-12-96
  5.     Last Updated $VER: v1.1_(04-12-96) - Argument support
  6. */
  7.  
  8. Init:
  9.     CLS = "H"                /* Clearscreen Command */
  10.     Signal On BREAK_C                /* Break Trapping      */
  11.     SpyFile = "LOGS:BioWare.log"        /* For Expansion       */
  12.  
  13.     Parse Arg TagField OutField
  14.         OutField = Strip(OutField)
  15.  
  16.     Options Results
  17.  
  18. WatchTrigger:
  19.     CURRENTFIELD TagField
  20.     GETFIELD TagField
  21.  
  22. CheckStatus:
  23.     If RESULT='0' | RESULT='' then do
  24.         ToDate = ''
  25.         Signal OutDate
  26.     end
  27.  
  28. FormatDate:                        /*YYYYmmDD*/
  29.     TDay = Right(Date(s),2)            /*  ||||==*/
  30.     TMon = Left(Right(Date(s),4),2)    /*  ||==  */
  31.     TYar = Right(Left(Date(s),4),2)    /*  ==    */
  32.         ToDate = TDay||'-'||TMon||'-'||TYar
  33.  
  34.  
  35. OutDate:
  36.     CURRENTFIELD OutField
  37.     PUTFIELD ToDate
  38.  
  39. Exzit:
  40.     Exit
  41.  
  42.